package pf.springBoot.springBootSSO.oAuth;

import javax.annotation.PostConstruct;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import pf.java.pfHelper.config.PFAppConfig;
import pf.java.pfHelperMvc.config.PFCookieUtils;
//import pf.java.pfHelper.config.PFCookieUtils;
import pf.springBoot.springBootSSO.service.UserService;

@Component
public class TestBean {
    private static PFAppConfig _appConfig;
	 private static PFCookieUtils _cookieUtils;
	    private static String cookieKey="cookieKey";
	    
	    private static HttpServletResponse response;
	    @Autowired
	    private HttpServletResponse response2;
//	 
	    private static HttpServletRequest request;

	    @Autowired
	    private HttpServletRequest request2;
    @Autowired
	public TestBean(PFAppConfig appConfig,PFCookieUtils cookieUtils) {
		_appConfig=appConfig;
		_cookieUtils=cookieUtils;
        response=response2;
	}
//    @PostConstruct
//    public void beforeInit() {
//        request=request2;
//        response=response2;
//    }
    public static Boolean UseLocalData()
    {
        //Cookie[] cookies = request.getCookies();
        
    	String aa=_cookieUtils.getCookieValue(cookieKey);
    	//Boolean result=_appConfig.getUseLocalData();
    	Boolean result=_appConfig.getUseLocalData();
            return result;
    }
}
